package com.meida.module.bus.client.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.NoArgsConstructor;

/**
 * 证件类型
 *
 * @author jzy
 * @date 2021/7/9
 */
@NoArgsConstructor
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum IdentityTypeEnum implements IEnum<Integer> {

    /**
     * 证件类型 1.身份证 2.护照 3.港澳通行证 4.台胞证 5.其他
     */
    ShengFenZheng(1, "身份证"),
    HuZhao(2, "护照"),
    GangAoTongXingZheng(3, "港澳通行证"),
    TaiBaoZheng(4, "台胞证"),
    QiTa(5, "其他");

    private Integer value;

    @ApiModelProperty("描述")
    private String label;

    IdentityTypeEnum(Integer value, String label) {
        this.value = value;
        this.label = label;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public static IdentityTypeEnum getByValue(Integer value) {
        for (IdentityTypeEnum identityTypeEnum : values()) {
            if (identityTypeEnum.getValue() == value) {
                return identityTypeEnum;
            }
        }
        return null;
    }
}
